/*!
    \copyright  Copyright (c) 2020 - 2025 Qualcomm Technologies International, Ltd.
                All Rights Reserved.
                Qualcomm Technologies International, Ltd. Confidential and Proprietary.
    \file
    \addtogroup ui_indicator
    \brief      Private messages and symbols used by the UI Indicator module.
    @{
*/
#ifndef UI_PRIVATE_H
#define UI_PRIVATE_H

#include <csrtypes.h>

#include "ui_indicator_prompts_types.h"
#include "ui_indicator.h"

#define UI_KYMERA_RESOURCE_LOCKED 1U

extern uint16 ui_audio_resource_lock;

static inline uint16 *ui_GetAudioResourceLockAddress(void)
{
    return &ui_audio_resource_lock;
}

static inline bool ui_IsAudioResourceLocked(void)
{
    return (ui_audio_resource_lock == UI_KYMERA_RESOURCE_LOCKED);
}

static inline void ui_SetAudioResourceLock(void)
{
    ui_audio_resource_lock = UI_KYMERA_RESOURCE_LOCKED;
}

static inline void ui_ClearAudioResourceLock(void)
{
    ui_audio_resource_lock = 0;
}

void uiPrompts_SchedulePromptPlay(MessageId sys_event);

void uiPrompts_PlayPrompt(MessageId sys_event, rtime_t time_to_play, const ui_prompt_data_t *config);

bool uiPrompts_FindQueuedLocalPrompt(Task task, MessageId id, Message payload);

void uiPrompts_ClearInterruptingUiNotification(void);

void uiPrompts_HandleInterruptingPrompt(void);

void UiPrompts_SetAudioFrameworkRequested(void);

/* Audio SS platform abstraction interface */

void UiPrompts_AudioSpecificInit(void);

void UiIndicator_PromptAudioStart(rtime_t time_to_play, const ui_prompt_data_t *config, FILE_INDEX index);

void UiIndicator_PromptAudioStop(void);

rtime_t UiIndicator_PromptAudioGetGraphSetupTimeMicroseconds(const ui_prompt_data_t *config);

/* Prompt Configuration Accessors */

bool uiPrompts_GetPromptIndexFromMappingTable(MessageId id, uint16 *prompt_index);

const ui_prompt_data_t * uiPrompts_GetDataForPrompt(MessageId sys_event);

bool uiPrompts_IsPromptMandatory(MessageId sys_event);

bool uiPrompts_IsPromptPlayAlways(MessageId sys_event);

bool uiPrompts_IsPromptLocalOnly(MessageId sys_event);

/* User Prompts */

const ui_event_indicator_table_t *uiPrompts_GetDataForUserEvent(MessageId id);

bool uiPrompts_IsUserHandledPrompt(MessageId id);

const ui_prompt_data_t *uiPrompts_GetDataForUserPrompt(MessageId id);

bool uiPrompts_IsIdInUserTable(MessageId id);

#endif // UI_PRIVATE_H

/*! @} */